Skip to content

Consistently use local database as the default#5145

Closed
icopp wants to merge 1 commit into
supabase:developfrom
icopp:use-local-database-as-default
Closed

Consistently use local database as the default#5145
icopp wants to merge 1 commit into
supabase:developfrom
icopp:use-local-database-as-default

Conversation

@icopp

@icopp icopp commented Apr 28, 2026

Copy link
Copy Markdown

What kind of change does this PR introduce?

The codebase currently has a truly nightmare state of commands randomly defaulting to the linked project or the local database depending on specific command, including some commands that mutate the database like migration repair. This change makes them all consistently default to the local database only, explicitly requiring --linked or --db-url to do anything destructive to another database. The change in default behavior will likely take a major version bump, but should save a lot of people from pain in the future.

What is the current behavior?

The only way to know which commands default to local behavior and which default to remote behavior is to individually look at the docs of every command.

See for example, #3493

What is the new behavior?

Every command defaults to local. A user must explicitly use --linked or --db-url to do anything that reads or affects anything but the local dev database.

The codebase currently has a truly nightmare state of commands randomly defaulting to the linked project or the local database depending on specific command, including some commands that mutate the database like `migration repair`. This change makes them all consistently default to the local database only, explicitly requiring `--linked` or `--db-url` to do anything destructive to another database. The change in default behavior will likely take a major version bump, but should save a lot of people from pain in the future.

For an example, see: supabase#3493
@icopp icopp requested a review from a team as a code owner April 28, 2026 17:21
@icopp icopp changed the title fix: consistently use local database as the default Consistently use local database as the default Apr 28, 2026
@jgoux

jgoux commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Hello, thanks for your contribution.

We're currently porting all the commands to TypeScript so I'll close this PR but be sure that we heard the feedback and we agree with your proposal.

We're working on simplifying the API surface of the CLI and we will have a way to chose between local-first vs remote-first globally when running commands.

@jgoux jgoux closed this Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants